/**
 * Created by yc on 2017/5/23.
 */
const headers = {
    'Content-Type': 'json'
};


console.log(headers['Accept'] === undefined);

const isEmpty = (value) => {
    if(value === null || value === undefined || value === '' || value.trim() === '') {
        return true;
    }
    return false;
}

const getUrl = (url, data) => {
    if(typeof(url) == 'undefined' || url == null || url == '') {
        return '';
    }
    if(typeof(data) == 'undefined' || data == null || typeof(data) != 'object') {
        return '';
    }
    url += (url.indexOf("?") != -1) ? "" : "?";
    for(var k in data) {
        url += ((url.indexOf("=") != -1) ? "&" : "") + k + "=" + encodeURI(data[k]);
    }
    return url;
};
console.log(typeof getUrl);


let user = {
    name: 'yc',
    age: 12,
    school: 'huaguan',
    work: 'sursen'
}

const {name, age, ...props} = user;
console.log(name);
console.log(age);
console.log(...props);
